﻿using System;
using SlimDX.Windows;
using Viewer.Exceptions;
using ParticlesEngine.Core;
using ParticlesEngine.Primitives;
using SlimDX.D3DCompiler;
using SlimDX.Direct3D11;

namespace Viewer
{
    static class Program
    {
        public static AboutProgram aboutBox = new AboutProgram();
        public static Viewer form;
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
       
        static void Main()
        {
            form = new Viewer("Zaawansowane Efekty Cząsteczkowe");

            try
            {
                form.InitializeGraphics();
                Scene triangleScene = new Scene();
                GraphicComponent triangle = new Triangle();
                triangle.Effect = form.LoadEffect("triangle.fx");
                form.sceneManager.AddScene(triangleScene);
                triangleScene.AddComponent(triangle);                
                MessagePump.Run(form, () =>
                {
                    form.UpdateFrame();
                    form.Draw();
                });
            }
            catch (ViewerException e)
            {
                e.ToString();
            }

        }

        
    }
}
